home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
AMIGA
/
AMICUS
/
AMICUS25.ADF
/
8ColorWB
/
ChngIcon.bas
(
.txt
)
< prev
next >
Wrap
AmigaBASIC Source Code
|
1989-01-26
|
2KB
|
61 lines
DEFLNG a-z
DECLARE FUNCTION PutDiskObject LIBRARY
DECLARE FUNCTION GetDiskObject LIBRARY
CHDIR ":bmaps":LIBRARY "icon.library":CHDIR ":utilities"
INPUT "Enter icon to change >",f1$:f1$=f1$+CHR$(0)
obj1=GetDiskObject(SADD(f1$))
IF obj1<>0 THEN
INPUT "Enter icon to get TYPE data from >",f2$:f2$=f2$+CHR$(0)
obj2=GetDiskObject(SADD(f2$))
IF obj2<>0 THEN
PRINT "Data icon structure is as follows:":GOSUB show
POKEL obj2+22,PEEKL(obj1+22) 'point to new image
POKEL obj2+12,PEEKL(obj1+12) 'set to new image size
stat=PutDiskObject(SADD(f1$),obj2) 'write it out
PRINT
IF stat=0 THEN
PRINT "ERROR WHILE WRITING ICON!"
ELSE
PRINT "Icon is now TYPE OF the above icon."
END IF
FreeDiskObject obj2
ELSE
PRINT :PRINT "Couldn't get info for data icon!"
END IF
FreeDiskObject obj1
ELSE
PRINT :PRINT "Couldn't get info for image icon!"
END IF
LIBRARY CLOSE
END
'FOR i=0 TO 83 STEP 4:PRINT i,:FOR j=0 TO 3:PRINT PEEK(i+j+obj);:NEXT:PRINT :NEXT
IF obj=0 THEN BEEP :ELSE GOSUB show
IF obj<>0 THEN FreeDiskObject obj
LIBRARY CLOSE
END
show:
PRINT obj
PRINT PEEKW(obj2+0),"magic number"
PRINT PEEKW(obj2+2),"version"
PRINT "gadget structures"
PRINT " ";PEEKW(obj2+12),"X size"
PRINT " ";PEEKW(obj2+14),"Y size"
PRINT " ";PEEKL(obj2+22),"image structptr."
PRINT PEEK(obj2+48),"TYPE OF"
PRINT PEEKL(obj2+52),"default tool"
PRINT PEEKL(obj2+54),"tooltypes"
PRINT PEEKL(obj2+58),"current xpos"
PRINT PEEKL(obj2+62),"current ypos"
PRINT PEEKL(obj2+66),"drawer data"
PRINT PEEKL(obj2+70),"tool window"
PRINT PEEKL(obj2+74),"stack"
RETURN